<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>考勤表</title>
    
    <meta name="viewport" content="width=device-width,initial-scale=1" />
	<link rel="stylesheet" type="text/css" href="css/f/navs.css">
	<link rel="stylesheet" type="text/css" href="css/f/default.css">
	<link rel="stylesheet" type="text/css" href="css/f/yhy.css">
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
  </head>
 
  <body>
  <div class="all">
  	<jsp:include page="/nav.jsp"></jsp:include>
	  	<div class="rightall float-left">
		  	<div class="already">
			  	<div class="already-title">
			  		<div class="left">考勤 </div>
			  	</div>
				    	<div class="abc">
								<form action="cadre/queryAttendance.do?pageNo=${pageNo }" method="post">
									<select class="danxuan" id="second" name="courseId">
									  <c:forEach var="k" items="${cours }">
									    <c:if test="${cId==k.courseId }">
									      <option value="${k.courseId }" selected="selected">${k.courseName }</option>
									    </c:if>
									    <c:if test="${cId!=k.courseId }">
									      <option value="${k.courseId }" >${k.courseName }</option>
									    </c:if>
									  </c:forEach>
									</select>
									
									<input  class="gezidaxiao" type="text" name="search" placeholder="学生姓名/ 学生id" value="${ni }">
									<input class="btn-style-er" type="submit" value="查询"><br/>
						     	</form>
							</div>
 
					<br/>
					<table>
						<tr class="tr-style-head">
							<td>所在小组</td>
							<td>组长id</td>
							<td>学生姓名</td>
							<td>是否迟到</td>
							<td>是否早退</td>
							<td>是否请假</td>
						</tr>
			    	<c:forEach var="k" items="${kao }">
						<tr class="tr-style">
							<td>${k.squadName }</td>
							<td>${k.squadleader }</td>
							<td>${k.stuName }</td>
							<td>
								<c:if test="${k.arriveLateState == 1}"><span style="color:blue;">正常</span></c:if>
								<c:if test="${k.arriveLateState == 2}"><span style="color:red;">迟到</span></c:if>
							</td>
							<td>
								<c:if test="${k.leaveEarlyState == 1}"><span style="color:blue;">正常</span></c:if>
								<c:if test="${k.leaveEarlyState == 2}"><span style="color:red;">早退</span></c:if>
							</td>
							<td>
								<c:if test="${k.begOffState == 1}"><span style="color:blue;">正常</span></c:if>
								<c:if test="${k.begOffState == 2}"><span style="color:red;">请假</span></c:if>
								<c:if test="${k.begOffState == 3}"><span style="color:red;">未请假</span></c:if>
							</td>
					  </tr>
					</c:forEach>	
					</table>
			     <c:if test="${pages > 1 }">
               		   <div class="previous" style="text-align: center;">
	               		<c:if test="${pageNo>1}">
	                    	<a href="cadre/queryAttendance.do?courseId=${cId }&pageNo=${pageNo-1}">上一页</a>
	                	</c:if>
	                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
	                   		<c:if test="${p==pageNo }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNo }">
	                   			<a href="cadre/queryAttendance.do?courseId=${cId }&pageNo=${p }" >&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	                   	</c:forEach>
	                    <c:if test="${pageNo<pages}">
	                    	<a href="cadre/queryAttendance.do?courseId=${cId }&pageNo=${pageNo+1}">下一页</a>
	                	</c:if>
                   </div>
                </c:if>
				</div>
			</div>
	</div>
  </body>
</html>
